package com.ktvme.controller;

import com.km.result.Result;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;

/**
 * <p></p>
 * Created by @author zhezhiyong@163.com on 2018/8/27.
 */
@RestController
public class IndexController {

    @Value("${eureka.instance.metadataMap.version}")
    private String version;

    @RequestMapping("/version")
    public Result version(HttpServletRequest request){
        String token = request.getHeader("token");
        System.out.println("token = " + token);
        System.out.println("version = " + version);
        return Result.success(Arrays.asList(version.split(",")));
    }

}
